<script setup>
import { judgeShowImage, uniNavigateTo } from '@/utils'

const props = defineProps({
  info: {
    type: Object,
    default: () => ({}),
  },
})
</script>

<template>
  <view
    class="programme-item"
    @tap.stop="uniNavigateTo(`/pages-sub/programme/detail/index?id=${info.id}`)"
  >
    <image
      class="programme-item-img"
      :src="judgeShowImage(info.coverUrl)"
      mode="aspectFill"
    ></image>
    <view class="flex flex-1 flex-col justify-between">
      <view class="programme-item-title">{{ info.name }}</view>
      <view class="flex justify-between items-center">
        <view class="programme-item-desc">
          节目类型：{{ info.category_dictText }}
        </view>
        <view class="programme-item-desc">
          节目时长：{{ info.duration }}分钟
        </view>
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
.programme-item {
  display: flex;
  align-items: stretch;
  padding: 32rpx 0;
  border-bottom: 1rpx solid $uni-border-color;

  &-img {
    flex-shrink: 0;
    width: 100rpx;
    height: 80rpx;
    margin-right: 24rpx;
    border-radius: 8rpx;
  }

  &-title {
    color: $uni-text-color;
    font-size: 28rpx;
    font-weight: 500;
  }

  &-desc {
    color: $uni-text-color-grey;
    font-size: 24rpx;
  }
}
</style>
